package cn.ahaoweb.drule.core.compile.provide;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @Name: 下拉选项框
 * @Description:
 * @Author: wangzhonghao
 * @Date: 2025/2/8 10:50
 */
@Data
public class SelectItem implements Serializable {

    // 显示名
    private String label;

    // 值
    private String value;

    // 描述
    private String desc;

    // 类型
    private String type;

    // 子选项
    private List<SelectItem> children;

    public static SelectItem of(String label, String value){
        SelectItem selectItem = new SelectItem();
        selectItem.label = label;
        selectItem.value = value;
        return selectItem;
    }

    public static SelectItem of(String label, String value, String type){
        SelectItem selectItem = new SelectItem();
        selectItem.label = label;
        selectItem.value = value;
        selectItem.type = type;
        return selectItem;
    }

}
